<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>菜鸟教程 React 实例</title>
<script src="https://cdn.staticfile.org/react/16.4.0/umd/react.development.js"></script>
<script src="https://cdn.staticfile.org/react-dom/16.4.0/umd/react-dom.development.js"></script>
<script src="https://cdn.staticfile.org/babel-standalone/6.26.0/babel.min.js"></script>
</head>
<body>
<h1>为继承自 React.Component的组件设置默认属性 ComponentName.defaultProps = {key:value}</h1>
<div id="example"></div>
<script type="text/babel">
class HelloMessage extends React.Component {
  render() {
    return (
		<div>
		<h1>{this.props.name}</h1>
		<p>{this.props.desc}</p>
		</div>
      
    );
  }
}

HelloMessage.defaultProps = {
	name : "梁朝伟",
	desc : "明明说好三年，三年之后又三年，三年之后又三年，都快十年了，老大"
}

const element = <HelloMessage/>;

ReactDOM.render(
  element,
  document.getElementById('example')
);
</script>

</body>
</html>